<?php

declare (strict_types=1);
namespace App\Model;

use Hyperf\DbConnection\Model\Model;
/**
 * @property int $id
 * @property int $user_id
 * @property int $friend_id
 * @property int $friend_group_id
 */
class Friend extends Model
{
    /**
     * The table associated with the model.
     *
     * @var string
     */
    protected $table = 'friend';
    /**
     * The attributes that are mass assignable.
     *
     * @var array
     */
    protected $fillable = [];
    /**
     * The attributes that should be cast to native types.
     *
     * @var array
     */
    protected $casts = ['id' => 'int', 'user_id' => 'integer', 'friend_id' => 'integer', 'friend_group_id' => 'integer'];


    public function friendGroupInfo()
    {
        return $this->belongsTo(Friend::class, 'friend_group_id', 'id');
    }


    public function userInfo()
    {
        return $this->belongsTo(User::class, 'user_id', 'id');
    }
}
